<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['项目管理','厂区日报']" icon="fa fa-smile-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>厂区日报</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module">																	 							
									<span class="module_text">安装点名称</span>	
									<sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>										
								</div>
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">数值过滤</span>
                                    <select name="" class="top_module_select" [(ngModel)]="quantityType" >
                                        <option value="">全部</option>
                                        <option value="0">安装数量</option>
                                        <option value="1">维修数量</option>
                                        <option value="2">剩余散装(套)</option>
										<option value="3">剩余袋装(套)</option>
                                    </select>
                                </div>
                                <!--<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">排序顺序</span>
                                    <select name="" class="top_module_select" [(ngModel)]="sortType">
                                        <option value="1">由高到低</option>
                                        <option value="0">由低到高</option>
                                    </select>
                                </div>
                                <div class="top_module top_module_box">
                                    <span class="module_text">数量</span>
                                    <input type="text" class="module_inp top_module_select" [(ngModel)]="quantityType" placeholder="数量"/>
								</div>-->
								<div class="top_module top_module_box">
									<span class="module_text">上传人员</span>
									<input type="text" class="module_inp top_module_select" [(ngModel)]="userName" placeholder="上传人员"/>
								</div>
								<div class="top_module top_module_box">
                                    <span class="top_module_label module_text">排序</span>
                                    <select name="" class="top_module_select" (change)='sortChange()' #sortSelect>
                                        <option value="1" data-sort="0" data-type="1">安装数量由高到低</option>
                                        <option value="2" data-sort="0" data-type="0">安装数量由低到高</option>
                                        <option value="3" data-sort="1" data-type="1">维修数量由高到低</option>
                                        <option value="4" data-sort="1" data-type="0">维修数量由低到高</option>
                                        <option value="5" data-sort="2" data-type="1">剩余设备(散装)由高到低</option>
                                        <option value="6" data-sort="2" data-type="0">剩余设备(散装)由低到高</option>
                    					<option value="7" data-sort="3" data-type="1">剩余设备(袋装)由高到低</option>
                                        <option value="8" data-sort="3" data-type="0">剩余设备(袋装)由低到高</option>
                                    </select>
                                </div>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1"  autocomplete="off" placeholder="选择开始时间"/>
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2"  autocomplete="off" placeholder="选择结束时间"/>
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
									
								</div>
								
								<button  type="button"  class="btn btn-primary" (click)="table_search()">查询</button>
								<!-- <button type="button" class="btn btn-primary" (click)="exportData()">导出</button> -->
							</div>
							<!--<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌号...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>-->
						</div>
						<div class="table_scroll" style="height: 620px;">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>安装点名称</th>
										<th>现场安装情况</th>
										<th>今日安装数量</th>
										<th>维修数量</th>
										<th>维修事项</th>
										<!-- <th>剩余设备(套)</th> -->
										<th>剩余设备(散装)</th>
										<th>剩余设备(袋装)</th>
										<th>天气</th>
										<th>传感器数量</th>
										<th>基座数量</th>
										<th>电源线数量</th>
										<th>8米延长线数量</th>
										<th>10米延长线数量</th>
										<th>上传人员</th>
										<th>时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" [ngClass]="{'alert-flag':row.alertFlag}">
										<td>{{row.companyName}}</td>
										<td style="cursor: pointer;" (click)="editItemPage('现场安装情况','installationSituation',row)" title="点击编辑">
                                            {{row.installationSituation}}
                                        </td>
										<td style="cursor: pointer;" (click)="editItemPage('今日安装数量','installedNum',row)" title="点击编辑">
										    {{row.installedNum}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('维修数量','repairsNum',row)" title="点击编辑">
										    {{row.repairsNum}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('维修事项','maintenanceMatters',row)" title="点击编辑">
										    {{row.maintenanceMatters}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('剩余设备(散装)','fieldEquipmentSan',row)" title="点击编辑">
										    {{row.fieldEquipmentSan}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('剩余设备(袋装)','fieldEquipmentDai',row)" title="点击编辑">
										    {{row.fieldEquipmentDai}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('天气','weather',row)" title="点击编辑">
										    {{row.weather}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('传感器数量','sensorNum',row)" title="点击编辑">
										    {{row.sensorNum}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('基座数量','pedestalNum',row)" title="点击编辑">
										    {{row.pedestalNum}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('电源线数量','powerWireNum',row)" title="点击编辑">
										    {{row.powerWireNum}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('8米延长线数量','eightWireNum',row)" title="点击编辑">
										    {{row.eightWireNum}}
										</td>
										<td style="cursor: pointer;" (click)="editItemPage('10米延长线数量','tenWireNum',row)" title="点击编辑">
										    {{row.tenWireNum}}
										</td>
										<td>{{row.userName}}</td>
										<td>{{row.date}}</td>
										<td>
										    <button type="button" (click)="delRow(row)">删除</button>
											<button type="button" (click)="editRow(row)">编辑</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div style="height: 60px;line-height: 60px;text-align: center;color: #ccc;">
						    <span *ngIf="tableData.length > 0">共{{tableData.length}}条数据</span>
						    <span *ngIf="tableData.length == 0" >暂无数据</span>
						</div>
						<!-- <div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div> -->
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 编辑    弹窗-->
	<div id="projectDailyModal" class="modal fade" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="projectDailyCancel()" aria-label="Close">
	            <span aria-hidden="true">&times;</span>
	          </button>
					<h4 class="modal-title">厂区日报-编辑</h4>
				</div>
				<div class="modal-body">
					<div class="row form-horizontal">
					    <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">现场安装情况</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="text" [(ngModel)]='projectDailyFrom.installationSituation' name='installationSituation' placeholder="现场安装情况"/>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">今日安装数量</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="text" disabled [(ngModel)]='projectDailyFrom.installedNum' name='installedNum' placeholder="今日安装数量"/>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">维修数量</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled [(ngModel)]='projectDailyFrom.repairsNum' name='repairsNum' placeholder="维修数量"/>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">维修事项</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="text"  [(ngModel)]='projectDailyFrom.maintenanceMatters' name='maintenanceMatters' placeholder="维修事项"/>
                            </div>
                        </div>
                        
						<div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">剩余设备(散装)</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled  [(ngModel)]='projectDailyFrom.fieldEquipmentSan' name='fieldEquipmentSan' placeholder="剩余设备(散装)"/>
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">剩余设备(袋装)</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled  [(ngModel)]='projectDailyFrom.fieldEquipmentDai' name='fieldEquipmentDai' placeholder="剩余设备(袋装)"/>
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">天气</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="text"  [(ngModel)]='projectDailyFrom.weather' name='weather'placeholder="天气"/>
                            </div>
                        </div>

						<div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">传感器数量</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled  [(ngModel)]='projectDailyFrom.sensorNum' name='sensorNum' placeholder="传感器数量"/>
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">基座数量</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled  [(ngModel)]='projectDailyFrom.pedestalNum' name='pedestalNum' placeholder="基座数量"/>
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">电源线数量</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled  [(ngModel)]='projectDailyFrom.powerWireNum' name='powerWireNum' placeholder="电源线数量"/>
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">8米延长线数量</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled  [(ngModel)]='projectDailyFrom.eightWireNum' name='eightWireNum' placeholder="8米延长线数量"/>
                            </div>
                        </div>
						<div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">10米延长线数量</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="number" disabled  [(ngModel)]='projectDailyFrom.tenWireNum' name='tenWireNum' placeholder="10米延长线数量"/>
                            </div>
                        </div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="projectDailyCancel()">取消</button>
					<button type="button" class="btn btn-primary" (click)="projectDailySubmit()">确认</button>
				</div>
			</div>
		</div>
	</div>
	<!--编辑  end-->
	
	<!-- 单项编辑   弹窗-->
	<section id="itemModal" class="modal fade" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="itemModalClose()" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
					<h4 class="modal-title">{{itemPageForm.title}} - 编辑</h4>
				</div>
				<div class="modal-body">
					<div class="row form-horizontal">
					    <div class="form-group col-xs-12">
                            <label class="col-xs-3 control-label">{{itemPageForm.title}}</label>
                            <div class="col-xs-9">
                                <input class="form-control" type="text"  [(ngModel)]='projectDailyFrom[itemPageForm.key]' [attr.name]='itemPageForm.key' [attr.placeholder]="itemPageForm.title"/>
                            </div>
                        </div>
					    
					</div>
				</div>
				<div class="modal-footer">
                    <button type="button" class="btn btn-default" (click)="itemModalClose()">取消</button>
                    <button type="button" class="btn btn-primary" (click)="itemModalSubmit()">确认</button>
                </div>
			</div>
		</div>
	</section>
	<!-- 图片查看 弹窗end-->	
</div>
<style type="text/css">
	.picture{
		min-height: 100px;
		width: 100%;
		height: auto;
	}
	.alert-flag td{
	    color: red!important;
	}

	thead th{
		background-color: #f9f9f9;
		/*min-width: 100px;*/
		position:-webkit-sticky; 
		position:sticky;
		top:0;
		z-index: 3;
	}
	thead th:nth-of-type(1){
		background-color: #f9f9f9;
		left:0;
		z-index:4;
	}
	tbody td{
		/*min-width: 100px;*/
		position:-webkit-sticky; position:sticky;
	}
	tbody td:nth-of-type(1){
		background-color: #f9f9f9;
		font-weight: bold;
		left: 0;
		z-index:3;
	}
</style>